import os


# 删除返回的excel文件
def delete_excel_files(target_folder):
    for file in os.listdir(target_folder):
        if file.endswith('.xlsx') or file.endswith('.xls'):
            os.remove(os.path.join(target_folder, file))


# 目录下有文件就删除
def delete_files_in_directory(target_directory):
    for filename in os.listdir(target_directory):
        file_path = os.path.join(target_directory, filename)
        if os.path.isfile(file_path):
            os.remove(file_path)
